{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>提现管理</span>
            <span class="icon-angle-right"></span>
            <span>提现申请列表</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <form class="layui-form">
                <table class="m-table">
                    <tbody class="datas">
                        <tr>
                            <th width="5%">ID</th>
                            <th width="8%">头像</th>
                            <th width="10%">昵称</th>
                            <th width="10%">店铺名称</th>
                            <th width="10%">提现金额</th>
                            <th width="5%">提现方式</th>
                            <th width="7%">状态</th>
                            <th width="10%">提现时间</th>
                            <th width="10%">操作</th>
                        </tr>
                        {foreach name="data" item="v"}
                        <tr>
                            <td>{$v.id}</td>
                            <td><img src="{$v.headimgurl}" alt="" style="display: block; width: 50px; height: 50px;" /></td>
                            <td>{$v.nickname}</td>
                            <td>{$v.business_name}</td>
                            <td>{$v.money}元</td>
                            <td>{$v.withdrawal_method}</td>
                            <td>{$v.status_txt}</td>
                            <td>{$v.created_at}</td>
                            <td>
                                {if condition="$v['status'] eq 0"}
                                    <a data-id="{$v.id}" data-status="1" class="u-exam">审核通过</a>
                                    <a data-id="{$v.id}" data-status="2" class="u-exam">审核不通过</a>
                                {/if}
                                <a class="u-exam1" href="{:url('show', ['id' => $v.id])}">查看信息</a>
                            </td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </form>
            {include file="public:page" /}
        </div>
    </div>
</div>
{/block}
{block name="extrajs"}
{include file="laypage" /}
<script>
    layui.use(['layer'], function(){
        var layer = layui.layer;
        
        $('.u-exam').on('click', function(){
            var id     = $(this).attr('data-id');
            var status = $(this).attr('data-status');
            layer.confirm('您确定执行此操作吗？', {
                btn: ['确定','取消'] //按钮
            }, function(){
                $.post('{:url("examine")}', {id: id, status: status}, function(ret){
                    if (ret.status == 0) {
                        dialog.success(ret.message, function(){
                            window.location.reload();
                        })
                    }
                }, 'json');
            }, function(){
              
            });
        })
    })
</script>
{/block}